/*
 * Filename : SOCErrorMessageReader.java 
 * Package : com.spi.soconversion
 * Created by: Software Paradigms International Group, LLC. (SPI) 
 * Copyright (c) 2010 HBC
 */

package com.spi.soconversion.util;
import java.util.ResourceBundle;

/**
 * This class provides methods for getting Error Messages used in Sales Order Conversion Application.
 * <p>
 * Issues:
 * <p>
 * NONE
 * <p>
 * History:
 * <p>
 * <ul>
 * <li>2010.04.17 pk: created
 * </ul>
 * 
 * @author Priya Khanna, SPI (pk)
 */

public class ErrorMessageReader {
	
	/**
	 * Constant indicates the fully qualified name of configuration file
	 */
	private static final String RESOURCE_BUNDLE =
		"com.spi.soconversion.util.SOCErrors";
	
	/**
	 * Reference to the resource bundle
	 */
	private static final ResourceBundle MESSAGE_BUNDLE =
		ResourceBundle.getBundle(RESOURCE_BUNDLE);

	/**
	 * This method returns the error corresponding to the integer lookup
	 * provided.	 
	 * @param lookup - lookup The integer that represents the error to report
	 * @return String - The error for the given lookup
	 */
	public static String getError(int lookup)
	{
		String result = null;
		if (null != MESSAGE_BUNDLE)
		{
			result = MESSAGE_BUNDLE.getString(Integer.toString(lookup));
		}
		return result;
	}
}
